package com.altaic.structure ;

import com.isoft.gsrm2.client.util.YClientUtils ;

public class JapaneseNoun extends AltaicNoun
{
    //possesion
    //adjective(s)
    //ani no akai to nagai tsukue
    //benim kırmızı ve uzun masam
    //tsukue
    //+akai
    //+nagai
    //possesion
    //recurse for ani
    //watashi no ani
    //watashi no suki no ani
    //watashi no

    public JapaneseNoun( String noun )
    {
        super( noun ) ;
    }

    public void defineNoun( )
    {

    }

    @Override
    public String createRender( )
    {
        String res = "" ;

        if( this.possesion != null )
        {
            res += this.possesion.createRender( ) ;
            String possesionPostfix = PrepositionUtils.getPossesionPostfix( this ) ;
            res += " " + possesionPostfix + " ";
        }

        if( this.altaicAdjectives != null && this.altaicAdjectives.size( ) > 0 )
        {
            for( int i = 0; i < this.altaicAdjectives.size( ); i++ )
            {
                AltaicAdjective altaicAdjective = this.altaicAdjectives.get( i ) ;

                res += altaicAdjective.createRender( ) + " " ;
            }
        }

        res += this.word ;

        String stateStr = "" ;

        if( !YClientUtils.isBlankTrim( this.state ) )
        {
            if( NOUN_CASE_NOMINATIVE.equals( this.state ) )
            {
                //DO NOTHING
            }

            if( NOUN_CASE_ACCUSATIVE.equals( this.state ) )
            {
                stateStr = PrepositionUtils.getAcusativeMarker( this ) ;
            }

            if( NOUN_CASE_DATIVE.equals( this.state ) )
            {
                stateStr = PrepositionUtils.getDativeMarker( this ) ;
            }

            if( NOUN_CASE_LOCATIVE.equals( this.state ) )
            {
                stateStr = PrepositionUtils.getLocativeMarker( this ) ;
            }

            if( NOUN_CASE_ABLATIVE.equals( this.state ) )
            {
                stateStr = PrepositionUtils.getAblativeMarker( this ) ;
            }
        }

        res += " " + stateStr ;

        return res ;
    }

    public static void main( String[ ] args )
    {
        JapaneseNoun japaneseNoun = new JapaneseNoun( "ie" ) ;
        japaneseNoun.setState( AltaicNoun.NOUN_CASE_LOCATIVE ) ;

        japaneseNoun.addAdjective( new AltaicAdjective( "akai" ) ) ;
        japaneseNoun.addAdjective( new AltaicAdjective( "ookii" ) ) ;
        japaneseNoun.addAdjective( new AltaicAdjective( "hiroi" ) ) ;

        String rendered = japaneseNoun.createRender( ) ;
        System.out.println( rendered ) ;

    }

}
